package com.example.campus.config;


import com.example.campus.properties.MInIOProperties;
import com.example.campus.utils.MinIOUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class  MinIOConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public MinIOUtil minIOUtil(MInIOProperties mInIOProperties) {
        return new MinIOUtil(mInIOProperties.getEndpoint(), mInIOProperties.getAccessKey(),
                mInIOProperties.getSecretKey(), mInIOProperties.getBucketName());
    }
}
